#include <REGX52.H>
#include <INTRINS.H>
//控制蜂鸣器端口
sbit Buzzer=P2^5;

//蜂鸣器延时函数
void Buzzer_Delay500us(void)		//@12.000MHz
{
	unsigned char i;

	_nop_();
	i = 247;
	while (--i);
}


//控制蜂鸣器叫x毫秒
void Buzzer_Time(unsigned int x)
{
	unsigned int i = 0;
	for(i=0;i<x*2;i++)
		{
			Buzzer=!Buzzer;
			Buzzer_Delay500us();
		}
		//Buzzer=1;
}